version 18.0               // version control
set processors 8           // to ensure replicability across different numbers of cores
clear all                  // clear existing data
macro drop _all            // and macros, clean slate
set seed 20220613          // set seed

*-------------------------------------------------------
* project: daylight saving time (dst)
*-------------------------------------------------------

local pgm  "dst-data01_acs_employ_status_clean"           // file name
local who  "Muzhe Yang"                                   // author
local dte  "2022-06-13"                                   // created date
local dte2 "`c(current_date)'"                            // last run date
local tag  "`pgm'.do, created by `who' on `dte', last run on `dte2'"

capture log close
log using "code\management\\`pgm'.txt", replace text
display "`tag'"

import excel "data_raw\acs\acs_employ_status.xlsx", sheet("acs_employ_status") firstrow clear

gen double wk_hrs = B23020_001E
gen in_lbf = B23025_002E
gen not_in_lbf_pct = B23025_calc_pctNILFE
gen unemploy_pct = B23025_calc_pctUnempE

label variable wk_hrs         "avg. usual hours worked of pop. age 16-64 who have worked in past 12 months"
label variable in_lbf         "population in labor force"
label variable not_in_lbf_pct "% NOT in labor force"
label variable unemploy_pct   "% unemployed"

order wk_hrs in_lbf not_in_lbf_pct unemploy_pct, after(County)
keep GEOID State County /// 
     wk_hrs in_lbf not_in_lbf_pct unemploy_pct
codebook, compact
compress
save "data_clean\acs\\`pgm'.dta", replace 

log close
exit